package com.damon.authority.dal.entity;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 系统应用实体项
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年11月01日 10:57
 */
@Entity
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "t_platform_app", catalog = "db_kylin_artwork")
public final class ApplicationEntry extends BaseEntry implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", unique = true)
    private Long appId;

    /** 应用编码，自动生成，客户端请求时带上 */
    @Column(length = 16)
    private String code;

    /** 秘钥 自动生成*/
    @Column(length = 64)
    private String secret;

    /** 区分不同系统 */
    @Column(length = 16)
    private String catalog;

    /** 状态：正常，冻结 */
    @Column private Integer state;

    @Column(name = "tenant_id")
    private Long tenantId;
}
